#!/bin/bash

#=======================================================================
# slowdown
# File ID: cfa94aca-a2d5-11e3-a97b-001f3b596ec9
# [Description]
# License: GNU General Public License version 2 or later.
#=======================================================================

test -e /ubstud.mrk || { echo slowdown: This is not ubstud >&2; exit 1; }
tmp_bef=/tmp/slowdown_bef.tmp
tmp_aft=/tmp/slowdown_aft.tmp
until sudo echo Password OK | grep -q "Password OK"; do
    :
done
sudo cpufreq-info >$tmp_bef
sudo cpufreq-set --cpu 0 --max "800MHz"
sudo cpufreq-set --cpu 1 --max "800MHz"
sudo cpufreq-info
echo
echo ==== diff between before and after execution:
echo
sudo cpufreq-info >$tmp_aft
diff -U0 $tmp_bef $tmp_aft
